import request from '@/utils/request'

// 获取销售区域列表
export function listSalesArea(data) {
    return request({
        url: '/system/salesArea/list',
        method: 'get',
        params: data
    })
}

// 获取销售区域详细信息
export function detailSalesArea(id) {
    return request({
        url: '/system/salesArea/getInfo?areaId=' + id,
        method: 'get'
    })
}

// 过滤销售区域
export function querySalesArea(data) {
    return request({
        url: 'system/salesArea/filterQuery',
        method: 'get',
        params: data
    })
}

// 销售区域增加
export function addSalesArea(data) {
    return request({
        url: '/system/salesArea/add',
        method: 'post',
        data: data
    })
}

// 销售区域编辑
export function editSalesArea(data) {
    return request({
        url: '/system/salesArea/edit',
        method: 'post',
        data: data
    })
}

// 删除销售区域
export function deleteSalesArea(id) {
    return request({
        url: '/system/salesArea/remove?areaId=' + id,
        method: 'post'
    })
}

// 检测是否含有子集
export function checkSalesArea(id) {
    return request({
        url: '/system/salesArea/checkSalesArea?areaId=' + id,
        method: 'get'
    })
}

// 根据销售区域查询客户
export function searchSalesArea(data) {
    return request({
        url: '/system/customerInformation/getCustomerListByArea',
        method: 'get',
        params: data
    })
}